package com.yixun.qfbao.xf.model.enums;

import org.apache.commons.lang.StringUtils;

/**
 * 
 * @author zilong.liu
 * @date 2020-08-09
 *
 */
public enum RelTypeEnum {

	attention(0, "关注"),
    shop(1, "店铺");



	RelTypeEnum(Integer code,String des){
        this.code = code;
        this.des = des;
    }

    public static RelTypeEnum getByDescription(String des) {
        if(StringUtils.isBlank(des)){
            return null;
        }
        for (RelTypeEnum menum : values()) {
            if (menum.getDes().equals(des)) {
                return menum;
            }
        }
        return null;
    }
    public static RelTypeEnum getByNo(Integer no) {
        for (RelTypeEnum menum : values()) {
            if (menum.getCode().compareTo(no) == 0) {
                return menum;
            }
        }
        return null;
    }

    private final Integer code;

    private final String des;

    public Integer getCode() {
        return code;
    }
    
    public Integer getNo() {
        return code;
    }

    public String getDes() {
        return des;
    }
}
